import request from '@/utils/request'

// 查询红包列表
export function listEnvelope(query) {
  return request({
    url: '/mch/envelope/list',
    method: 'get',
    params: query
  })
}

// 查询红包详细
export function getEnvelope(reId) {
  return request({
    url: '/mch/envelope/' + reId,
    method: 'get'
  })
}

//所有的商户
export function allMch() {
  return request({
    url: '/mch/config/all',
    method: 'get'
  })
}

//获取url
export function createUrl(data) {
  return request({
    url: '/mch/envelope/reUrl',
    method: 'get',
    params: data
  })
}

// 修改红包
export function updateEnvelope(data) {
  return request({
    url: '/mch/envelope',
    method: 'put',
    data: data
  })
}

// 删除红包
export function delEnvelope(reId) {
  return request({
    url: '/mch/envelope/' + reId,
    method: 'delete'
  })
}

// 导出红包
export function exportEnvelope(query) {
  return request({
    url: '/mch/envelope/export',
    method: 'get',
    params: query
  })
}
